﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;

#endregion

namespace InterLinq.Test {
	/// <summary>
	/// Represents a order that contains n order positions
	/// </summary>
	[Serializable]
	public class Order : IOrder {
		#region Public Properties

		/// <summary>
		/// Gets the order position of the order
		/// </summary>
		public IList<IOrderPosition> OrderPositions { get; private set; }

		/// <summary>
		///  gets the unique id of the order
		/// </summary>
		public Guid Id { get; private set; }

		/// <summary>
		///  gets the name of the order
		/// </summary>
		public string Name { get; set; }

		#endregion

		#region Public Methods

		public Order () {
			OrderPositions = new List<IOrderPosition> ();
			Id = Guid.NewGuid ();
			Name = Encoding.ASCII.GetString (MD5.Create ().ComputeHash (Id.ToByteArray ()));
		}

		#endregion

		#region Private Methods

		// private methods located here

		#endregion
	}
}